﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for User
/// </summary>
public class ThanhVien  //lớp thành viên
{
    public string TenDangNhap { get; set; }
    public string MatKhau { get; set; }
    public int QuyenHan { get; set; }
    public string HoVaTen { get; set; }
    public string Email { get; set; }
    public string DiaChi { get; set; }
    public string SoDT { get; set; }

   

    AccessData ac=new AccessData();           
    public void DangKy(ThanhVien tv)
    {
        SqlConnection con = ac.GetConnect();
        con.Open();
        SqlCommand cmd=new SqlCommand("DangKy",con);
        cmd.CommandType = CommandType.StoredProcedure;
        cmd.Parameters.Add("@TenDangNhap", SqlDbType.NVarChar).Value = tv.TenDangNhap;
        cmd.Parameters.Add("@MatKhau", SqlDbType.NVarChar).Value = tv.MatKhau;
        cmd.Parameters.Add("@QuyenHan", SqlDbType.TinyInt).Value = tv.QuyenHan;
        cmd.Parameters.Add("@HoVaTen", SqlDbType.NVarChar).Value = tv.HoVaTen;
        cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = tv.Email;
        cmd.Parameters.Add("@DiaChi", SqlDbType.NVarChar).Value = tv.DiaChi;
        cmd.Parameters.Add("@SoDT", SqlDbType.NVarChar).Value = tv.SoDT;
        cmd.ExecuteNonQuery();
        con.Close();
        cmd.Dispose();
    }
}